package com.runa.monitor.platinterface.dispatch.conn;

import com.runa.monitor.platinterface.dispatch.grpcComm.FlowUnitComm;
import io.grpc.stub.StreamObserver;
import lombok.extern.slf4j.Slf4j;


@Slf4j
public class FlowUnitCommStreamResponse implements StreamObserver<FlowUnitComm> {

    private Client client;

    public FlowUnitCommStreamResponse(Client client) {
        this.client = client;
    }


    @Override
    public void onNext(FlowUnitComm flowUnitComm) {

    }

    @Override
    public void onError(Throwable throwable) {
        log.error("flow unit error: {}", throwable);
        client.delayLogin();
    }

    @Override
    public void onCompleted() {
    }
}
